home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5199 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: int main() vs int main(void)
  5. Date: 8 Feb 1996 14:10:41 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4fd091$b8q@sparcserver.lrz-muenchen.de>
  9. References: <1996Feb7.201848.18734@atlas.tntech.edu>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. jad7084@tntech.edu (Jim Davis) writes:
  13.  
  14. >Okay, void main() is naughty, but there's something else I've been
  15. >wondering about, and I can't find it in the FAQ.
  16.  
  17. >Is there a difference between
  18.  
  19. >  int main()
  20. >  int main(void)
  21.  
  22. >?  () is equivalent to (void), right?  Does it matter?  Am I worried about
  23. >nothing?
  24.  
  25. 1) It depends on whether you are talking about C or about C++.
  26. 2) It depends on whether you are talking about a prototype or a 
  27.    function definition
  28. 3) It depends on wether you consider the different meanings in
  29.    a prototype as relevant or not. Since you usually don't 
  30.    provide a prototype for main(), the answer seems to be yes.
  31.  
  32. Kurt
  33. --
  34. | Kurt Watzka                             Phone : +49-89-2180-6254
  35. | watzka@stat.uni-muenchen.de
  36. | ua302aa@sunmail.lrz-muenchen.de
  37.